#ifndef THREAD_SEARCH_EVENT_H
#define THREAD_SEARCH_EVENT_H

#include <wx/event.h>
#include <wx/arrstr.h>

class ThreadSearchEvent : public wxCommandEvent {
  public:
    ThreadSearchEvent( wxEventType commandType = wxEVT_NULL, int id = 0 );
    ThreadSearchEvent( const ThreadSearchEvent& event );
    ~ThreadSearchEvent();
    virtual wxEvent *Clone() const {return new ThreadSearchEvent( *this );}
    DECLARE_DYNAMIC_CLASS( ThreadSearchEvent );
    wxArrayString GetLineTextArray() const {return m_LineTextArray;};
    void SetLineTextArray( const wxArrayString& ArrayString ) {m_LineTextArray = ArrayString;};
    size_t GetNumberOfMatches() const { return m_LineTextArray.GetCount() / 2; }
  private:
    wxArrayString m_LineTextArray;
};

typedef void ( wxEvtHandler::*ThreadSearchEventFunction )( ThreadSearchEvent& );

BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EXPORTED_EVENT_TYPE(wxEVT_THREAD_SEARCH, wxID_ANY )
DECLARE_EXPORTED_EVENT_TYPE(wxEVT_THREAD_SEARCH_ERROR, wxID_ANY )
END_DECLARE_EVENT_TYPES()

#define EVT_THREAD_SEARCH(id, fn) \
  DECLARE_EVENT_TABLE_ENTRY(wxEVT_THREAD_SEARCH, id, -1, \
                            (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (ThreadSearchEventFunction) & fn,(wxObject *) NULL ),

#define EVT_THREAD_SEARCH_ERROR(id, fn) \
  DECLARE_EVENT_TABLE_ENTRY(wxEVT_THREAD_SEARCH_ERROR, id, -1, \
                            (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction) (ThreadSearchEventFunction) & fn,(wxObject *) NULL ),

#endif
